﻿@using Volo.CmsKit.Public.Web.Pages.CmsKit.Shared.Components.Tags

@model TagViewComponent.TagViewModel

<div class="my-3">
    <div class="cms-tags-area">
        @if (Model.Tags != null)
        {
            foreach (var tag in Model.Tags)
            {
                if (Model.UrlFormat.IsNullOrWhiteSpace())
                {
                    <span class="badge rounded-pill badge-secondary text-bg-secondary cmskit-tag font-weight-normal">
                        @tag.Name
                    </span>
                }
                else
                {
                    var formattedUrl = Model.UrlFormat.Replace("{TagId}", tag.Id.ToString()).Replace("{TagName}", tag.Name);
                    <a href="@formattedUrl"><span class="badge rounded-pill  badge-secondary text-bg-secondary rounded-pill cmskit-tag font-weight-normal">@tag.Name</span></a>
                }
            }
        }
    </div>
</div> 